package com.sk.places.places2.fb.service;

import com.visural.common.StringUtil;

public class FBServiceImpl implements FBService {
	    // get these from your FB Dev App
	    private static final String api_key = "157461614311935";
	    private static final String secret = "a867a8b2e5322850e1bd7945653879fc";
	    private static final String client_id = "157461614311935";  

	    // set this to your servlet URL for the authentication servlet/filter
	    private static final String redirect_uri = AppConstants.HOST_NAME + "/fbAuthAction";
	    /// set this to the list of extended permissions you want
	    private static final String[] perms = new String[] {"publish_stream", "email"};

	    public static String getAPIKey() {
	        return api_key;
	    }

	    public static String getSecret() {
	        return secret;
	    }

	    public String getLoginRedirectURL() {
	        return "https://graph.facebook.com/oauth/authorize?client_id=" +
	            client_id + "&display=page&redirect_uri=" +
	            redirect_uri+"&scope="+StringUtil.delimitObjectsToString(",", perms);
	    }

	    public String getAuthURL(String authCode) {
	        return "https://graph.facebook.com/oauth/access_token?client_id=" +
	            client_id+"&redirect_uri=" +
	            redirect_uri+"&client_secret="+secret+"&code="+authCode;
	    }
}
